<%@page import="steed.domain.GlobalParam"%>
<%@page import="steed.util.digest.Md5Util"%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="java.util.Date"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script src="http://lib.sinaapp.com/js/jquery/1.9.1/jquery-1.9.1.min.js"></script>
<script type="text/javascript">
	
	//请求
	function subData(type){
		var temp = $("#params").val();
		if(temp==''){
			temp = "{}";
		}
		var temp = eval("("+temp+")");
		$.ajax({
			type:type,
			url:$("#URL").val(),
			data:temp,
			success:function(data2){
				$("#returnData").val(JSON.stringify(data2));
			}
		});
	}
	//请求
	function subData1(){
		var temp = $("#params").val();
		$.ajax({
			type:"post",
			url:$("#URL").val(),
			data:{"aa":temp},
			success:function(data2){
				$("#returnData").val(data2);
			}
		});
	}
</script>
<title>后台功能测试工具by战马</title>
<style type="text/css">
	table{width: 90%;}
	input[type=text]{width: 50%;}
</style>
</head>
<body>
<center>
	<table cellpadding="0" cellspacing="0">
		
		<tr>
			<td align="right">
				请求URL：
			</td>
			<td align="left">
				<input type="text" name="URL" id="URL" value="<%= GlobalParam.FOLDER.contextUrl%>"/>
			</td>
		</tr>
		<tr>
			<td colspan="2" align="center">
				<br/>
				<textarea rows="20" cols="120" id="params" style="background: black;color: white;font-size: 13px;"></textarea>
			</td>
		</tr>
		
		<tr>
			<td align="right">
				&nbsp;&nbsp;&nbsp;<!-- <input type="button" name="subBtn" id="subBtn" onclick="getToken();" value="获取Token"/> -->
			</td>
			<td align="left">
				&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
					<input type="button" name="subBtn1" id="subBtn1" onclick="subData('post');" value="请求post"/>
					<input type="button" name="subBtn1" id="subBtn2" onclick="subData('get');" value="请求(get)"/>
					<!-- <input style="display: none;" type="button" name="subBtn12" id="subBtn12" onclick="subData1();" value="请求(data方式)"/> -->
				&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
					<input type="button" name="subBtn2" id="subBtn2" onclick="javascript:$('#returnData').val('');" value="清空"/>
			</td>
		</tr>
		<tr>
			<td colspan="2" align="center">
				<br/>
				<textarea rows="20" cols="120" id="returnData" style="background: black;color: white;font-size: 13px;">返回的数据...</textarea>
			</td>
		</tr>
	</table>
	
</center>
</body>
</html>